package com.atguigu.gulimall.order.vo;

import java.math.BigDecimal;
import java.util.List;

/**
 * 购物车里的购物项
 */
public class OrderItemVo {
    private Long skuId; //商品id
    private Boolean check = true; //是否被选中
    private String title; //商品标题
    private String img; //商品图片
    private List<String> skuAttr; //商品参数
    private BigDecimal price; //价格
    private Integer count;//商品数量
    private BigDecimal totalPrice;//商品总价
    private boolean hashStock;


    public Boolean getHashStock() {
        return hashStock;
    }

    public void setHashStock(Boolean hashStock) {
        this.hashStock = hashStock;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Boolean getCheck() {
        return check;
    }

    public void setCheck(Boolean check) {
        this.check = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public List<String> getSkuAttr() {
        return skuAttr;
    }

    public void setSkuAttr(List<String> skuAttr) {
        this.skuAttr = skuAttr;
    }

    /**
     * 计算总价
     * @return
     */
    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(""+this.count));
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }
}
